package py.com.erpone.session.dm.list;

import java.util.List;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import py.com.erpone.entity.dm.Almacen;



@Stateless
@LocalBean
@Named
public class AlmacenList {
	
	@PersistenceContext
	private EntityManager em;
	
	
	@SuppressWarnings("unchecked")
	public List<Almacen> findAll(){
		List<Almacen> result=(List<Almacen>)em.createNamedQuery("almacen.all").getResultList();
		return result;
	}
	@SuppressWarnings("unchecked")
	public List<Almacen> findAllActivos(){
		List<Almacen> result=(List<Almacen>)em.createNamedQuery("almacenActivos.all").getResultList();
		return result;
	}
	@SuppressWarnings("unchecked")
	public List<Almacen> findAllDetalles(){
		List<Almacen> result=(List<Almacen>)em.createNamedQuery("almacenDetalles.all").getResultList();
		return result;
	}
	public Almacen findById(Long id){
		return em.find(Almacen.class, id);
	}
	
}
